package sat.component;

import org.mt4j.MTApplication;
import org.mt4j.components.visibleComponents.shapes.MTRectangle;
import org.mt4j.components.visibleComponents.shapes.MTRoundRectangle;
import org.mt4j.input.inputProcessors.componentProcessors.dragProcessor.DragProcessor;
import org.mt4j.input.inputProcessors.componentProcessors.rotateProcessor.RotateProcessor;
import org.mt4j.util.MTColor;
import org.mt4j.util.math.Vector3D;

// this class does not extend UMLPopUp, because it needn't entity type as a argument of the constructor
public class UseCasePopUp extends MTRectangle{
	public static final float width = 200;
	public static final float height = 30;

	protected MTRoundRectangle saveButton;
	protected MTRoundRectangle clearButton;
	protected MTRoundRectangle saveAndQuitButton;
	protected MTRoundRectangle quitButton;
	
	public UseCasePopUp(MTApplication mtApplication) {
		super(mtApplication, width, height);
		
		this.setFillColor(MTColor.WHITE);
		this.setStrokeColor(MTColor.BLACK);
		this.setStrokeWeight(1);

		//this.removeAllGestureEventListeners();
		this.removeAllGestureEventListeners(DragProcessor.class); // To enable drag & drop
		this.removeAllGestureEventListeners(RotateProcessor.class);
//		this.removeAllGestureEventListeners(ScaleProcessor.class);
		
		saveButton = new DragAndDropButton(mtApplication,DragAndDropButton.ButtonType.SAVE,"sv.png");
		clearButton = new DragAndDropButton(mtApplication,DragAndDropButton.ButtonType.CLEAR,"clear.png");
		saveAndQuitButton = new DragAndDropButton(mtApplication,DragAndDropButton.ButtonType.SAVEANDQUIT,"ok.png");
		quitButton = new DragAndDropButton(mtApplication,DragAndDropButton.ButtonType.QUIT,"quit.png");

		saveButton.setPositionRelativeToParent(new Vector3D(-DragAndDropButton.cornerRadius,-DragAndDropButton.cornerRadius));
		clearButton.setPositionRelativeToParent(new Vector3D(width+DragAndDropButton.cornerRadius,-DragAndDropButton.cornerRadius));
		saveAndQuitButton.setPositionRelativeToParent(new Vector3D(-DragAndDropButton.cornerRadius,height+DragAndDropButton.cornerRadius));
		quitButton.setPositionRelativeToParent(new Vector3D(width+DragAndDropButton.cornerRadius,height+DragAndDropButton.cornerRadius ));
		
		this.addChild(saveButton);
		this.addChild(clearButton);
		this.addChild(saveAndQuitButton);
		this.addChild(quitButton);

		this.setVisible(false);

	}
}
